home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / iritsm3s.zip / LOOPS.IRT < prev    next >
Text File  |  1991-12-15  |  1KB  |  66 lines

  1. #
  2. # This file existance is justified to demonstrate loops:
  3. #
  4.  
  5. #
  6. # This loop uses the beep function to generate tones in different frequency
  7. # and time. Unix systems does not support it.
  8. #
  9. if ( machine, "=", msdos,
  10.   for ( (b = 100), 100, 300,
  11.     for    ( (a = 100), 100, 2000,
  12.             (
  13.               beep(a, b)
  14.             )
  15.         )
  16.     )
  17. );
  18.  
  19. save_mat = view_mat;
  20. view_mat = view_mat * scale(vector(0.7,    0.7, 0.7));
  21.  
  22. b = box(vector(-0.5, -0.2, -0.1), 1, 0.4, 0.2);
  23.  
  24. rot10x = rotx(10);
  25. rot10y = roty(10);
  26. rot10z = rotz(10);
  27.  
  28. #
  29. # Rotate around    the X axes:
  30. #
  31.  
  32. for ( (a = 1), 1, 36,
  33.         (
  34.           (view_mat = rot10x * view_mat):
  35.           view(list(b,axes), on)
  36.         )
  37.     );
  38.  
  39.  
  40. #
  41. # Rotate around    the Y axes:
  42. #
  43.  
  44. for ( (a = 1), 1, 36,
  45.         (
  46.           (view_mat = rot10y * view_mat):
  47.           view(list(b,axes), on)
  48.         )
  49.     );
  50.  
  51.  
  52. #
  53. # Rotate around    the Z axes:
  54. #
  55.  
  56. for ( (a = 1), 1, 36,
  57.         (
  58.           (view_mat = rot10z * view_mat):
  59.           view(list(b,axes), on)
  60.         )
  61.     );
  62.  
  63. view_mat = save_mat;
  64.  
  65. free(rot10x); free(rot10y); free(rot10z);
  66.